<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GspellEntry: gspell 1 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="gspell 1 Reference Manual">
<link rel="up" href="GtkEntry-support.html" title="GtkEntry Support">
<link rel="prev" href="GspellEntryBuffer.html" title="GspellEntryBuffer">
<link rel="next" href="annexes.html" title="Part III. Annexes">
<meta name="generator" content="GTK-Doc V1.33.2 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GspellEntry.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GspellEntry.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GspellEntry.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="GtkEntry-support.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GspellEntryBuffer.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="annexes.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GspellEntry"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GspellEntry.top_of_page"></a>GspellEntry</span></h2>
<p>GspellEntry — Spell checking support for GtkEntry</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GspellEntry.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GspellEntry.html" title="GspellEntry"><span class="returnvalue">GspellEntry</span></a> *
</td>
<td class="function_name">
<a class="link" href="GspellEntry.html#gspell-entry-get-from-gtk-entry" title="gspell_entry_get_from_gtk_entry ()">gspell_entry_get_from_gtk_entry</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GspellEntry.html#gspell-entry-basic-setup" title="gspell_entry_basic_setup ()">gspell_entry_basic_setup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="returnvalue">GtkEntry</span></a> *
</td>
<td class="function_name">
<a class="link" href="GspellEntry.html#gspell-entry-get-entry" title="gspell_entry_get_entry ()">gspell_entry_get_entry</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GspellEntry.html#gspell-entry-get-inline-spell-checking" title="gspell_entry_get_inline_spell_checking ()">gspell_entry_get_inline_spell_checking</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GspellEntry.html#gspell-entry-set-inline-spell-checking" title="gspell_entry_set_inline_spell_checking ()">gspell_entry_set_inline_spell_checking</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GspellEntry.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> *</td>
<td class="property_name"><a class="link" href="GspellEntry.html#GspellEntry--entry" title="The “entry” property">entry</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
<td class="property_name"><a class="link" href="GspellEntry.html#GspellEntry--inline-spell-checking" title="The “inline-spell-checking” property">inline-spell-checking</a></td>
<td class="property_flags">Read / Write</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GspellEntry.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GspellEntry.html#GspellEntry-struct" title="GspellEntry">GspellEntry</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GspellEntry.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> GspellEntry
</pre>
</div>
<div class="refsect1">
<a name="GspellEntry.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gspell/gspell.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GspellEntry.description"></a><h2>Description</h2>
<p><a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> extends the <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> class with inline spell checking.
Misspelled words are highlighted with a red <code class="literal">PANGO_UNDERLINE_SINGLE</code>.
Right-clicking a misspelled word pops up a context menu of suggested
replacements. The context menu also contains an “Ignore All” item to add the
misspelled word to the session dictionary. And an “Add” item to add the word
to the personal dictionary.</p>
<p>For a basic use-case, there is the <a class="link" href="GspellEntry.html#gspell-entry-basic-setup" title="gspell_entry_basic_setup ()"><code class="function">gspell_entry_basic_setup()</code></a> convenience
function.</p>
<p>If you don't use the <a class="link" href="GspellEntry.html#gspell-entry-basic-setup" title="gspell_entry_basic_setup ()"><code class="function">gspell_entry_basic_setup()</code></a> function, you need to call
<a class="link" href="GspellEntryBuffer.html#gspell-entry-buffer-set-spell-checker" title="gspell_entry_buffer_set_spell_checker ()"><code class="function">gspell_entry_buffer_set_spell_checker()</code></a> to associate a <a class="link" href="GspellChecker.html" title="GspellChecker"><span class="type">GspellChecker</span></a> to the
<a href="https://developer.gnome.org/gtk3/GtkEntryBuffer.html#GtkEntryBuffer-struct"><span class="type">GtkEntryBuffer</span></a>.</p>
<p>Note that <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> extends the <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> class but without subclassing
it, because <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> is already subclassed by <a href="https://developer.gnome.org/gtk3/GtkSearchEntry.html#GtkSearchEntry-struct"><span class="type">GtkSearchEntry</span></a> for example.</p>
<p><code class="literal">PANGO_UNDERLINE_SINGLE</code> is used for consistency with <a class="link" href="GspellTextView.html" title="GspellTextView"><span class="type">GspellTextView</span></a>.
If you want a <code class="literal">PANGO_UNDERLINE_ERROR</code> instead (a wavy underline), please fix
<a class="ulink" href="https://bugzilla.gnome.org/show_bug.cgi?id=763741" target="_top">this bug</a> first.</p>
</div>
<div class="refsect1">
<a name="GspellEntry.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gspell-entry-get-from-gtk-entry"></a><h3>gspell_entry_get_from_gtk_entry ()</h3>
<pre class="programlisting"><a class="link" href="GspellEntry.html" title="GspellEntry"><span class="returnvalue">GspellEntry</span></a> *
gspell_entry_get_from_gtk_entry (<em class="parameter"><code><a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> *gtk_entry</code></em>);</pre>
<p>Returns the <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> of <em class="parameter"><code>gtk_entry</code></em>
. The returned object is guaranteed
to be the same for the lifetime of <em class="parameter"><code>gtk_entry</code></em>
.</p>
<div class="refsect3">
<a name="gspell-entry-get-from-gtk-entry.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gtk_entry</p></td>
<td class="parameter_description"><p>a <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gspell-entry-get-from-gtk-entry.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> of <em class="parameter"><code>gtk_entry</code></em>
. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gspell-entry-basic-setup"></a><h3>gspell_entry_basic_setup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gspell_entry_basic_setup (<em class="parameter"><code><a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> *gspell_entry</code></em>);</pre>
<p>This function is a convenience function that does the following:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Set a spell checker. The language chosen is the one returned by
<a class="link" href="GspellLanguage.html#gspell-language-get-default" title="gspell_language_get_default ()"><code class="function">gspell_language_get_default()</code></a>.</p></li>
<li class="listitem"><p>Set the <a class="link" href="GspellEntry.html#GspellEntry--inline-spell-checking" title="The “inline-spell-checking” property"><span class="type">“inline-spell-checking”</span></a> property to <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p></li>
</ul></div>
<p>Example:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="n">GtkEntry</span> <span class="o">*</span><span class="n">gtk_entry</span><span class="p">;</span>
<span class="n">GspellEntry</span> <span class="o">*</span><span class="n">gspell_entry</span><span class="p">;</span>

<span class="n">gspell_entry</span> <span class="o">=</span> <span class="n">gspell_entry_get_from_gtk_entry</span> <span class="p">(</span><span class="n">gtk_entry</span><span class="p">);</span>
<span class="n">gspell_entry_basic_setup</span> <span class="p">(</span><span class="n">gspell_entry</span><span class="p">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<p>This is equivalent to:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="n">GtkEntry</span> <span class="o">*</span><span class="n">gtk_entry</span><span class="p">;</span>
<span class="n">GspellEntry</span> <span class="o">*</span><span class="n">gspell_entry</span><span class="p">;</span>
<span class="n">GspellChecker</span> <span class="o">*</span><span class="n">checker</span><span class="p">;</span>
<span class="n">GtkEntryBuffer</span> <span class="o">*</span><span class="n">gtk_buffer</span><span class="p">;</span>
<span class="n">GspellEntryBuffer</span> <span class="o">*</span><span class="n">gspell_buffer</span><span class="p">;</span>

<span class="n">checker</span> <span class="o">=</span> <span class="n">gspell_checker_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
<span class="n">gtk_buffer</span> <span class="o">=</span> <span class="n">gtk_entry_get_buffer</span> <span class="p">(</span><span class="n">gtk_entry</span><span class="p">);</span>
<span class="n">gspell_buffer</span> <span class="o">=</span> <span class="n">gspell_entry_buffer_get_from_gtk_entry_buffer</span> <span class="p">(</span><span class="n">gtk_buffer</span><span class="p">);</span>
<span class="n">gspell_entry_buffer_set_spell_checker</span> <span class="p">(</span><span class="n">gspell_buffer</span><span class="p">,</span> <span class="n">checker</span><span class="p">);</span>
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">checker</span><span class="p">);</span>

<span class="n">gspell_entry</span> <span class="o">=</span> <span class="n">gspell_entry_get_from_gtk_entry</span> <span class="p">(</span><span class="n">gtk_entry</span><span class="p">);</span>
<span class="n">gspell_entry_set_inline_spell_checking</span> <span class="p">(</span><span class="n">gspell_entry</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="gspell-entry-basic-setup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gspell_entry</p></td>
<td class="parameter_description"><p>a <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gspell-entry-get-entry"></a><h3>gspell_entry_get_entry ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="returnvalue">GtkEntry</span></a> *
gspell_entry_get_entry (<em class="parameter"><code><a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> *gspell_entry</code></em>);</pre>
<div class="refsect3">
<a name="gspell-entry-get-entry.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gspell_entry</p></td>
<td class="parameter_description"><p>a <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gspell-entry-get-entry.returns"></a><h4>Returns</h4>
<p>the <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> of <em class="parameter"><code>gspell_entry</code></em>
. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gspell-entry-get-inline-spell-checking"></a><h3>gspell_entry_get_inline_spell_checking ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gspell_entry_get_inline_spell_checking
                               (<em class="parameter"><code><a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> *gspell_entry</code></em>);</pre>
<div class="refsect3">
<a name="gspell-entry-get-inline-spell-checking.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>gspell_entry</p></td>
<td class="parameter_description"><p>a <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gspell-entry-get-inline-spell-checking.returns"></a><h4>Returns</h4>
<p> the value of the <a class="link" href="GspellEntry.html#GspellEntry--inline-spell-checking" title="The “inline-spell-checking” property"><span class="type">“inline-spell-checking”</span></a> property.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gspell-entry-set-inline-spell-checking"></a><h3>gspell_entry_set_inline_spell_checking ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gspell_entry_set_inline_spell_checking
                               (<em class="parameter"><code><a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> *gspell_entry</code></em>,
                                <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enable</code></em>);</pre>
<p>Sets the <a class="link" href="GspellEntry.html#GspellEntry--inline-spell-checking" title="The “inline-spell-checking” property"><span class="type">“inline-spell-checking”</span></a> property.</p>
<div class="refsect3">
<a name="gspell-entry-set-inline-spell-checking.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>gspell_entry</p></td>
<td class="parameter_description"><p>a <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>enable</p></td>
<td class="parameter_description"><p>the new state.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
</div>
<div class="refsect1">
<a name="GspellEntry.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GspellEntry-struct"></a><h3>GspellEntry</h3>
<pre class="programlisting">typedef struct _GspellEntry GspellEntry;</pre>
</div>
</div>
<div class="refsect1">
<a name="GspellEntry.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GspellEntry--entry"></a><h3>The <code class="literal">“entry”</code> property</h3>
<pre class="programlisting">  “entry”                    <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a> *</pre>
<p>The <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry-struct"><span class="type">GtkEntry</span></a>.</p>
<p>Owner: GspellEntry</p>
<p>Flags: Read / Write / Construct Only</p>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GspellEntry--inline-spell-checking"></a><h3>The <code class="literal">“inline-spell-checking”</code> property</h3>
<pre class="programlisting">  “inline-spell-checking”    <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
<p>Whether the inline spell checking is enabled.</p>
<p>Even if this property is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <a class="link" href="GspellEntry.html" title="GspellEntry"><span class="type">GspellEntry</span></a> disables internally the
inline spell checking in case the <a href="https://developer.gnome.org/gtk3/GtkEntry.html#GtkEntry--visibility"><span class="type">“visibility”</span></a> property is
<a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<p>Owner: GspellEntry</p>
<p>Flags: Read / Write</p>
<p>Default value: FALSE</p>
<p class="since">Since: <a class="link" href="api-index-1-4.html#api-index-1.4">1.4</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.2</div>
</body>
</html>